﻿@helper ReturnFirstLI(HtmlString htmlCode)
    {
        try
        {
            if (htmlCode != null)
            {
                string[] result = htmlCode.ToString().Split(new string[] { "<li>", "</li>" }, StringSplitOptions.RemoveEmptyEntries);
                if (result.Length > 1)
                {
    <span class="field-validation-error">@result[1]</span>
                }
            }
        }
        catch (ArgumentException)
        {
    <span></span>
        }
        catch (NullReferenceException)
        {
    <span></span>
        }
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
    <title>@ViewBag.Title</title>
    <link rel="SHORTCUT ICON" href="@Url.Content("~/Content/favicon.ico")"/>
    <link href="@Url.Content("~/Content/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <link href='http://fonts.googleapis.com/css?family=Irish+Grover' rel='stylesheet' type='text/css' />
    <link href='http://fonts.googleapis.com/css?family=La+Belle+Aurore' rel='stylesheet' type='text/css' />
    <link href="@Url.Content("~/")" id="siteRoot" />
    <script src="@Url.Content("~/Scripts/Framework.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/EditorHookup.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/RangeDateValidator.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>
<body>
    <div id="header">
        <h1>
            <a href="@Url.Content("~/")">sport meet planner</a>
            @if (User.Identity.IsAuthenticated)
            {
                <a id="rightHeaderButton" href="@Url.Content("~/Account/LogOff")">
                    <img src="@Url.Content("~/Content/Images/headerButtonLogOff.png")" alt="LogOff" /></a>
            }
            else
            {
                <a id="rightHeaderButton" href="@Url.Content("~/Account/LogOn")">
                    <img src="@Url.Content("~/Content/Images/headerButtonLogOn.png")" alt="LogOn" /></a>
            }
        </h1>
    </div>
    <div id="content">
        @if (User.Identity.IsAuthenticated)
        {
            <div class="section">
                <table class="listTable">
                    <tr>
                        <td class="headerColumn" colspan="2">
                            @ViewBag.Title
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Logged on as: @User.Identity.Name
                        </td>
                    </tr>
                </table>
            </div>
        }
        @RenderBody()
    </div>
    <div id="footer">
        @ReturnFirstLI(Html.ValidationSummary(false))
    </div>
    <script type="text/javascript">
        window.onload = FocusOnFirstTextbox;
    </script>
</body>
</html>
